package de.sas.za_expression.model;

public class NumberAttribut extends Attribut {
	
	private double wert;

	public NumberAttribut(String name, double wert)
	{
		super(name);
		this.setWert(wert);
	}


	public double getWert() {
		return wert;
	}

	public void setWert(double wert) {
		this.wert = wert;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (obj instanceof Double)
		{
			double comp = (double) obj;			
			return wert == comp;
		}
		
		return false;
	}
	
	public boolean bigger(double comp)
	{
		return wert > comp;
	}
	
	public boolean smaller(double comp)
	{
		return wert < comp;
	}
	
	@Override
	public String toString() {
		String returnString = "NumberAttribut: Name=" + getName() + ", Wert=" + wert;
		return returnString;
	}
}
